using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Specialized;
using NTTHAO.Web.BL.Authentication;
using NTTHAO.CommonWeb;

public partial class Sites_CanNhaMoUoc_Webparts_User_Activate : NTTHAO.CommonWeb.CommonUserControl
{
    public bool _UserActived = false;

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            NameValueCollection rawQuery = this.GetRawQuery();
            string email = rawQuery["email"];
            string key = rawQuery["key"];

            User user = new User(email);
            string md5Value = WebGlobal.MD5String(user.ID.ToString());

            if (md5Value.Equals(key, StringComparison.OrdinalIgnoreCase))
            {
                if (user.StatusID == 1)
                {
                    user.StatusID = 2;
                    user.Update();
                }
                _UserActived = true;
            }
        }
        catch { }
    }
}
